package info.magnolia.blossom.sample.cv.model;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Collection;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Field;
import org.apache.jackrabbit.ocm.mapper.impl.annotation.Node;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: peterbalazs
 * Date: 2/18/13
 * Time: 5:27 PM
 * To change this template use File | Settings | File Templates.
 */
@Node
public class CurriculumVitae implements Serializable {

    @Field(path = true)
    private String path;

    // identifier
    @Field
    private String id;

    // personal details
    @Field
    private String name;
    @Field
    private String address;
    @Field
    private Date dateOfBirth;
    @Field
    private Date startDate;
    @Collection(elementClassName = CVSkills.class)
    private List<CVSkills> languages;
    @Field
    private String currentDepartment;
    @Field
    private String currentRole;
    @Field
    private String pictureFileName;
    @Field
    private byte[] pictureFile;

    // skills
    @Collection(elementClassName = CVSkills.class)
    private List<CVSkills> skills;

    // experience
    @Collection(elementClassName = Experience.class)
    private List<Experience> experiences;

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
    }

    // setters & getters
    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getDateOfBirth() {
        return dateOfBirth;
    }

    public void setDateOfBirth(Date dateOfBirth) {
        this.dateOfBirth = dateOfBirth;
    }

    public List<CVSkills> getLanguages() {
        return languages;
    }

    public void setLanguages(List<CVSkills> languages) {
        this.languages = languages;
    }

    public List<CVSkills> getSkills() {
        return skills;
    }

    public void setSkills(List<CVSkills> skills) {
        this.skills = skills;
    }

    public List<Experience> getExperiences() {
        return experiences;
    }

    public void setExperiences(List<Experience> experiences) {
        this.experiences = experiences;
    }

    public String getCurrentDepartment() {
        return currentDepartment;
    }

    public void setCurrentDepartment(String currentDepartment) {
        this.currentDepartment = currentDepartment;
    }

    public String getCurrentRole() {
        return currentRole;
    }

    public void setCurrentRole(String currentRole) {
        this.currentRole = currentRole;
    }

    public String getPictureFileName() {
        return pictureFileName;
    }

    public void setPictureFileName(String pictureFileName) {
        this.pictureFileName = pictureFileName;
    }

    public byte[] getPictureFile() {
        return pictureFile;
    }

    public void setPictureFile(byte[] pictureFile) {
        this.pictureFile = pictureFile;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }
}
